package org.xiaofeipapa.feimall.userApi.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.xiaofeipapa.feimall.orderApiClient.OrderFeignClient;

import javax.annotation.Resource;

/**
 */
@RestController
public class UserAuthController {

    @Value("${server.port}")
    private String serverPort;

    @RequestMapping(value="/hello", method = RequestMethod.GET)
    private String hello(){
        return "我是 user service, 端口为： " + serverPort;
    }

    @Resource
    OrderFeignClient orderFeignClient;

    @RequestMapping(value="/test_feign", method = RequestMethod.GET)
    private String testFeign(){
        String v1 = "我是 user service, 端口为： " + serverPort;

        String result = ", 从order api 得到: " + orderFeignClient.internalHello();

        return v1 + result;
    }

}
